//
//  RecommendCellModel.swift
//  SLQuickReader
//
//  Created by 孙林 on 2017/8/10.
//  Copyright © 2017年 ALin. All rights reserved.
//

import UIKit
import Kingfisher

class RecommendCellModel: BaseViewModel, BaseView {
    
    var recommendBook: Book?
    
    func bind(to view: UIView...) {
        guard view.first is RecommendCell else {
            return
        }
        
        guard let book = recommendBook else {
            return
        }
        let cell = view.first as! RecommendCell
        cell.imgView.setImageWithUrl(book.cover, placeHolder: nil)
        cell.titleLabel.text = book.title
        cell.authorLabel.text = book.author
        cell.shortInfoLabel.text = book.shortIntro
    }
}
